var inputJSON = require('../../ns1.0/api/data/udap/api/v1/portal/app/topo#GET.json')
var auto = require('hy5b/auto/index')
var apiTest = require('hy5b/auto/api-test')
var lines = inputJSON.data.lines

var Random = auto.Random;

var data = {}

lines.forEach(function(line, index) {
  const id = line.id
  if (Math.random() > 0.3) {
    data[id] = auto({
      [[line.prevId] + '|1-100']: 1,
      [[line.nextId] + '|1-100']: 1,
      'delay|0-1000': 1,
      'inputRate|0-100': 1,
      'failed|1': [true, false]
    })
  }
})

var ret = apiTest.makeResponse(null, true, { data })

console.log(JSON.stringify(ret, null, 2))